<div class="content-section documentation">
    <h1>Theming</h1>
    <p>Choose from a variety of themes or develop your own theme easily.</p>

    <h5>Architecture</h5>
    <img alt="Architecture" src="assets/showcase/images/architecture.jpg" class="architecture-image"/>
    <p class="mt-3">PrimeNG is a design agnostic library so unlike other UI libraries it does not enforce a certain styling such as material or bootstrap. In order to achieve this, styling has been
        separated into core and theme. Core resides inside PrimeNG to implement the structure of the components such as positioning whereas theme brings the colors, paddings
        and margins.</p>

    <h5>Themes</h5>
    <p>PrimeNG offers various free themes and premium themes along with premium templates that provide an application layout as well. All the free themes are built with
        the <a href="https://www.primefaces.org/designer/primeng">Theme Designer</a> and the npm package brings the CSS output of the theme whereas SCSS is kept as a premium feature
        in the designer. This means free themes are open source and for customization with SASS, a designer license needs to be acquired.</p>

    <h5>Customization</h5>
    <p>CSS of the themes share the same license as PrimeNG which is MIT, this means the generated CSS can be customized per your needs however this should be avoided if your customizations
        are not simple. For instance even to change a primary color, since there is no variable a find and replace should be performed various times. On the other hand, this can be achieved
        by changing a single variable e.g. $primaryColor. Visit the <a href="https://www.primefaces.org/designer/api/primeng/12.0.0">SASS API</a> for the documentation of available customization options.</p>

    <p><a href="https://www.primefaces.org/designer/primeng">Designer</a> is the ultimate tool to create your own PrimeNG experience powered by a SASS based theme engine
        with 500+ variables and a Visual Designer. PrimeNG only ships the generated CSS of <b>Material</b>, <b>Bootstrap</b>, <b>Saga</b>, <b>Vela</b>, <b>Arya</b>, <b>FluentUI</b> and legacy themes whereas Designer provides
        full access to the whole SASS structure and the variables of these pre-built themes for easier customization. In addition, designer provides exclusive premium themes to subscribers including <b>Soho</b>, <b>Viva</b>, <b>Mira</b> 
    and <b>Nano</b> that are not available in core PrimeNG distribution.</p>

    <p>Whether you have your own style guide or just need a custom theme, Designer API is the right tool to design and bring them to existence.</p>

    <p>Visit <a href="https://www.primefaces.org/designer/primeng">Designer API HomePage</a> for more information and live demos.</p>
    <a href="http://www.primefaces.org/designer/primeng" class="designer-image mb-3">
        <img alt="PrimeNG Designer" src="assets/showcase/images/prime-designer.jpg" style="width: 100%" />
    </a>

    <div class="designer-videos">
        <div class="grid">
            <div class="col-12 md:col-6">
                <div class="fluid-video">
                    <iframe width="560" height="315" src="https://www.youtube.com/embed/vXYFR9LZkCk" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                </div>
            </div>
            <div class="col-12 md:col-6">
                <div class="fluid-video">
                    <iframe width="560" height="315" src="https://www.youtube.com/embed/i819bmJnCCg" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                </div>
            </div>
        </div>
    </div>

    <h5>Dynamic Theming at Runtime</h5>
    <p>Themes can be switched on-the-fly so that users of your app can define their own experience. View <a href="https://dev.to/primetek/how-to-switch-your-angular-app-between-material-bootstrap-and-custom-themes-at-runtime-5788">article</a>
    and the video tutorial for the implementation details.</p>

    <div class="video-container" style="text-align: center;">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/5VOuUdDXRsE" frameborder="0" allowfullscreen></iframe>
    </div>

    <h5>Scaling</h5>
    <p>PrimeNG utilizes rem units to make sure the components blend in with the rest of your UI perfectly. This also enables scaling, for example changing the size of the components
        is easy as configuring the font size of your document. Code below sets the scale of the components based on 16px. If you reqire bigger or smaller components, just
        change this variable and components will scale accordingly.</p>
    
<app-code lang="css" ngNonBindable ngPreserveWhitespaces>
html &#123;
    font-size: 16px;
&#125;
</app-code>
            
    <p>Some commonly used components such as inputs, buttons and datatable also provide per component scaling with special classes. Components with specific scaling options
        are documented in their own documentation.</p>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;input pInputText type="text" class="p-inputtext-sm" /&gt;
&lt;button pButton label="Button" class="p-button-lg" /&gt;
</app-code>
            
    <h5>Local Styling</h5>
    <p>Theming styles the components globally, in case you required to change the style of a certain component for a specific use case use the class property and override the defaults.
        Example below changes the background of the panel. Note that this is only for local styling, if you require to change the background color of all the panels, a custom theme is a far better choice.</p>

<app-code lang="markup" ngNonBindable ngPreserveWhitespaces>
&lt;p-panel header="Custom Header" styleClass="dark-panel"/&gt;
</app-code>
            
<app-code lang="css" ngNonBindable ngPreserveWhitespaces>
.dark-panel.p-panel &#123;
    .p-panel-header &#123;
        background: #212121;
    &#125;
&#125;
</app-code>
     
    <p>If the style does not apply due to view encapsulation, try ng-deep scoping.</p>

<app-code lang="css" ngNonBindable ngPreserveWhitespaces>
:host ::ng-deep .dark-panel.p-panel &#123;
    .p-panel-header &#123;
        background: #212121;
    &#125;
&#125;
</app-code>

    <h5>Utility Classes</h5>
    <p>A couple of utility classes are provided as a solution to common requirements.</p>

    <div class="doc-tablewrapper">
        <table class="doc-table">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Description</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>p-component</td>
                    <td>Applies component theming such as font-family and font-size to an element.</td>
                </tr>
                <tr>
                    <td>p-disabled</td>
                    <td>Applies an opacity to display as disabled.</td>
                </tr>
                <tr>
                    <td>p-sr-only</td>
                    <td>Element becomes visually hidden however accessibility is still available.</td>
                </tr>
                <tr>
                    <td>p-reset</td>
                    <td>Resets the browsers defaults.</td>
                </tr>
                <tr>
                    <td>p-link</td>
                    <td>Renders a button as a link.</td>
                </tr>
                <tr>
                    <td>p-error</td>
                    <td>Indicates an error text.</td>
                </tr>
                <tr>
                    <td>p-text-secondary</td>
                    <td>Applies the text color of the theme with the secondary priority.</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
